Skip to content

fix bug using reserved keyword in logger - #127

Merged
pooleycodes merged 1 commit into
mainfrom
bug/log-saving-reserved-field
Jul 17, 2026
Merged

fix bug using reserved keyword in logger#127
pooleycodes merged 1 commit into
mainfrom
bug/log-saving-reserved-field

Conversation

@pooleycodes

@pooleycodes pooleycodes commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update

Description

When building the warning log, we unpacked error_log into the log record's extra fields. One of its keys, message, is a reserved LogRecord field, so the logging call raised a KeyError. Because that log call runs before we save the error to the database, the exception aborted the handler and the detailed error message was never written to the response.

Related Tickets & Documents

  • Ticket Link
  • Related Issue #
  • Closes #

QA Instructions, Screenshots, Recordings

Please replace this line with instructions on how to test your changes, a note
on the devices and browsers this has been tested on, as well as any relevant
images for UI changes.

Added/updated tests?

We encourage you to keep the code coverage percentage at 80% and above. Please refer to the Digital Land Testing Guidance for more information.

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

[optional] Are there any post deployment tasks we need to perform?

[optional] Are there any dependencies on other PRs or Work?

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The handled Sentry reporting path now places error details under an error_log key within the event’s extra payload.

Changes

Sentry metadata

Layer / File(s) Summary
Nest handled error details
request-processor/src/tasks.py
The handled/user-error branch now nests error_log alongside request_id and task rather than flattening its fields into the Sentry extra payload.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: gibahjoe

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main fix by describing a logger-related bug in the Sentry handling path.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bug/log-saving-reserved-field

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pooleycodes
pooleycodes merged commit 1da8fa6 into main Jul 17, 2026
3 checks passed
@pooleycodes
pooleycodes deleted the bug/log-saving-reserved-field branch July 17, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants